
#[derive(PartialEq,Debug,Clone, Copy)]
pub enum BlendMode {
    /**
     * Working only in WebGPU may improve the performance of large background images without alpha.
     * The source pixel is not mixed with the target pixel, so the GPU will not read colors from the target pixel.
     */
    NONE,
    /**
     * Display objects above the background. When the background is transparent, 
     * the pixel values of the displayed object are not visible.
     */
    ABOVE,

    /**
     * Transparent mode
     */
    ALPHA,

    /**
     * Normal blend mode
     */
    NORMAL,

    /**
     * Add the values of the component colors of the displayed object to its background color
     */
    ADD,

    /**
     * Add the values of the component colors of the displayed object to its background color
     */
    BELOW,
    /**
     * Erase the background based on the alpha value of the displayed object.
     */
    ERASE,
    /**
     * Multiply the values of the displayed object's constituent colors by the background color, 
     * and then divide by 0xFF for normalization to obtain a darker color.
     */
    MUL,
    /**
     * Multiply the inverse of the components of the source and target images, and then calculate the inverse result.
     */
    SCREEN,
    DIVD,
    SoftAdd,
}



pub struct ShaderState {
    pub blend_mode:BlendMode,
    pub depth_compare:wgpu::CompareFunction,
    pub depth_write_enable:bool,
    pub front_face:wgpu::FrontFace,
    pub cull_mode:wgpu::Face,
    pub topology:wgpu::PrimitiveTopology,
    pub depth_bias:u32,
    
    pub use_ligth:bool,
    pub use_probe:bool,
    pub accept_gi:bool,
    pub accept_shadow:bool,
    pub cast_shadow:bool,
    pub cast_reflection:bool,
    pub receive_env:bool,
    pub render_layer:u32,
    pub render_order:u32,
    pub unclipped_depth:bool,
    pub multisample:u32,
    pub label:String,
    pub use_z:bool,
    pub split_texture:bool,

    
}

impl Default for ShaderState {
    fn default() -> Self {
        Self {
            blend_mode: BlendMode::NONE,
            depth_compare: wgpu::CompareFunction::Less,
            depth_write_enable: true,
            front_face: wgpu::FrontFace::Ccw,
            cull_mode: wgpu::Face::Back,
            topology: wgpu::PrimitiveTopology::TriangleList,
            depth_bias: 10,
            use_ligth: false,
            use_probe: false,
            accept_gi: false,
            accept_shadow: false,
            cast_shadow: false,
            cast_reflection: false,
            receive_env: false,
            render_layer: 1000,
            render_order: 0,
            unclipped_depth: false,
            multisample: 0,
            label: "".to_owned(),
            use_z: true,
            split_texture: false,
        }
    }
}

